Add raw binary fixture support for gossip harness#216
Add raw binary fixture support for gossip harness#216cmoyes-jump wants to merge 6 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for harnesses that consume raw binary inputs (rather than serialized protobuf contexts) and produce a minimal raw output, primarily to support the gossip harness workflow end-to-end (download → convert → run).
Changes:
- Introduces a
raw_binary_ioflag onHarnessCtxand enables it forGossipHarness. - Adds logic to convert non-protobuf
.fixartifacts into harness-specific context protobufs (e.g..gossipctx) during repro fetching/debugging. - Updates the target execution path to pass raw bytes in and decode a 1-byte boolean result out; adds tests for raw crash → context conversion.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_scripts.py | Adds unit tests covering raw .fix conversion behavior (convert raw, skip valid fixtures). |
| src/test_suite/test_suite.py | Adds lineage→raw-harness inference and .fix→context conversion during repro workflows. |
| src/test_suite/sanitizer_utils.py | Builds sancov stub under $TMPDIR when set (else falls back to tempfile.gettempdir()). |
| src/test_suite/multiprocessing_utils.py | Adds raw-binary execution path for input + special-case decoding for 1-byte boolean output. |
| src/test_suite/fuzz_interface.py | Extends HarnessCtx with raw_binary_io configuration flag. |
| src/test_suite/fuzz_context.py | Enables raw_binary_io=True for GossipHarness. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Adds support for harnesses that consume/produce raw binary data (rather than protobuf-serialized contexts/effects), with initial enablement for the gossip harness and conversion of raw .fix crash artifacts into .gossipctx context files.
Changes:
- Introduce
HarnessCtx.raw_binary_ioand enable it forGossipHarness. - Convert raw
.fixcrash files into harness-specific context protobufs during repro download/debug flows. - Update
process_targetto send raw bytes (context.data) and decode single-byte boolean outputs for raw-binary harnesses; add focused tests for conversion.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_scripts.py |
Adds tests validating raw .fix → .gossipctx conversion and ensuring valid fixtures are not converted. |
src/test_suite/test_suite.py |
Adds harness inference from lineage and conversion of raw crashes to context protobufs in debug_mismatches / debug_mismatch. |
src/test_suite/multiprocessing_utils.py |
Updates target invocation to support raw-binary input/output handling in process_target. |
src/test_suite/fuzz_interface.py |
Adds raw_binary_io flag to the harness context interface. |
src/test_suite/fuzz_context.py |
Enables raw_binary_io for GossipHarness. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| converted = _convert_raw_crashes_to_contexts(globals.inputs_dir, harness) | ||
| if converted > 0: | ||
| default_harness_ctx = next( | ||
| name for name, obj in HARNESS_MAP.items() if obj is harness | ||
| ) |
| converted = _convert_raw_crashes_to_contexts( | ||
| globals.inputs_dir, harness_ctx_for_lineage | ||
| ) | ||
| if converted > 0: | ||
| default_harness_ctx = next( | ||
| name | ||
| for name, obj in HARNESS_MAP.items() | ||
| if obj is harness_ctx_for_lineage | ||
| ) |
| try: | ||
| meta = _MetadataOnlyFixture() | ||
| meta.ParseFromString(raw) | ||
| if meta.HasField("metadata") and meta.metadata.fn_entrypoint: |
| if harness_ctx.raw_binary_io and len(output_data) == 1: | ||
| for field_desc in output_object.DESCRIPTOR.fields: | ||
| if field_desc.type == field_desc.TYPE_BOOL: | ||
| setattr(output_object, field_desc.name, output_data[0] != 0) | ||
| break |
| if harness_ctx.raw_binary_io: | ||
| in_data = context.data | ||
| else: | ||
| serialized_instruction_context = context.SerializeToString(deterministic=True) | ||
| if serialized_instruction_context is None: |
No description provided.